import request from '@/config/axios'

export interface MallColumn {
  id?: number,
  icon?: string,
  title?: string,
  type?: string,
  sort?: number,
  status?: number,
  remark?: string
}

export interface ColumnProduct {
  id?: number,
  productId?: number,
  productName?: string,
  productImage?: string,
  salePrice?: number,
  payPrice?: number,
  sort?: number,
  activity?: number,
  activityType?: string,
  columnId?: number
}

export interface ColumnDetail {
  id?: number,
  icon?: string,
  title?: string,
  type?: string,
  sort?: number,
  status?: number,
  remark?: string,
  productNum?: number
}

export const getPageList = (params) => {
  return request.get({ url: '/infra/column/getPageList', params })
}


export const addMallColumn = (data: MallColumn) => {
  return request.post({url: '/infra/column/add', data})
}

export const editMallColumn = (data: MallColumn) => {
  return request.post({url: '/infra/column/update', data})
}

export const getColumnDetail = (params) => {
  return request.get({url: '/infra/column/getColumnDetail', params})
}

export const getProductList = (params) => {
  return request.get({ url: '/infra/column/getProductList', params })
}

export const addColumnProduct = (data) => {
  return request.post({url: '/infra/column/addProduct', data})
}

export const updateColumnProduct = (data) => {
  return request.post({url: '/infra/column/updateProduct', data})
}

export const deleteColumnProduct = (data) => {
  return request.post({url: '/infra/column/deleteProduct', data})
}